package com.zzxy.spring5.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

public class MyAspectJ {
    public void myBefore(JoinPoint jp){
        System.out.println(jp.getClass().getName());
        System.out.println("my before ...");
    }

    public void myAfter(JoinPoint jp){
        System.out.println(jp.getSignature().getName());
        System.out.println("my after ...");
    }

    public void myAfterReturing(JoinPoint jp,Object ret){
        System.out.println(jp.getSignature().getName());
        System.out.println("my after returning ..." + ret);
    }

    public void myThrowing(JoinPoint jp,Throwable e){
        System.out.println(jp.getSignature().getName());
        System.out.println("my throwing ..." + e.getMessage());

    }

    public Object myAround(ProceedingJoinPoint pjp) throws Throwable{
        System.out.println("my around before ...");
        Object obj = pjp.proceed();
        System.out.println("my around after ...");
        return obj;
    }

    public void myAfterReturning(org.aspectj.lang.JoinPoint joinPoint) throws Throwable {
    }

    private class JoinPoint {
    }
}